package com.shanshi.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class MyWallet extends MainActivity implements OnClickListener{

	private SharedPreferences sharedPreferences;
	private TextView tv;
	private TextView Iv;
	private Button rechargeBt;
	private Button cashBt;
	private ImageView mywallet_cancel;
	private ImageView mywallet_detail;
	private TextView mywallet_money;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mywallet);
		sharedPreferences = MyWallet.this.getSharedPreferences("share", MODE_PRIVATE);
		String money = sharedPreferences.getString("money","0.00");
		mywallet_money = (TextView) findViewById(R.id.mywallet_money);
		mywallet_money.setText("￥"+money);
		tv = (TextView) findViewById(R.id.titls2);
		tv.setText("我的钱包");
		Iv = (TextView) findViewById(R.id.cancel);
		Iv.setText("");
		rechargeBt = (Button) findViewById(R.id.mywallet_charge);
		rechargeBt.setOnClickListener(this);
		cashBt = (Button) findViewById(R.id.mywallet_cash);
		cashBt.setOnClickListener(this);
		mywallet_cancel = (ImageView) findViewById(R.id.mywallet_cancel);
		mywallet_cancel.setOnClickListener(this);
		mywallet_detail = (ImageView) findViewById(R.id.mywallet_detail);
		mywallet_detail.setOnClickListener(this);
	}
	
	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		
			case R.id.mywallet_charge:
				Intent rechargeBt =new Intent(MyWallet.this,RechargeCash.class);
				startActivity(rechargeBt);
				break;

			case R.id.mywallet_cancel:
				finish();
				break;
			case R.id.mywallet_cash:
				Intent cashBt =new Intent(MyWallet.this,WithDrawals.class);
				startActivity(cashBt);
			
				break;
			case R.id.mywallet_detail:
				Intent intent =new Intent(MyWallet.this,BillDetails.class);
				startActivity(intent);

				break;
		}
		
		
	}
}
